#include<bits/stdc++.h>
using namespace std;
int t;
int n;
const int N = 110;
string strs[N];

string path;

bool check()
{
    int i = 0, j = path.size() - 1;
    while (i <= j)
    {
        if (path[i] != path[j])
        {
            return false;
        }
        i++;
        j--;
    }
    return true;
}
bool dfs(int i)
{
    if (n == i)
    {
        return check();
    }
    int tem=strs[i].size();
    for (int j = 0; j < tem; j++)
    {
        path.push_back(strs[i][j]);
        if (dfs(i + 1)) return true;
        path.pop_back();
    }
    return false;
}
int main()
{
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 0; i < n; i++)
        {
            cin >> strs[i];
        }
        if (dfs(0))
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }
    return 0;
}



//双指针加哈希
#include<bits/stdc++.h>
using namespace std;
int t;
int n;
const int N = 110;
string strs[N];

string path;

bool check(string s1,string s2)
{
    set<char>s;
   for(auto&ch:s1)s.insert(ch);
    for(auto&ch:s2)
    {
        if(s.count(ch)) return true;
    }
    return false;
}

int main()
{
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 0; i < n; i++)
        {
            cin >> strs[i];
        }
        int left=0,right=n-1;
        bool falg=true;
        while(left<=right)
        {
            bool ret=check(strs[left],strs[right]);
            if(ret==false)
            {
                falg=false;
                break;
            }
            left++;
            right--;
        }
        if(falg) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}